package com.guchenbo.example.lock;

import java.util.LinkedHashMap;

/**
 * @Author guchenbo
 * @Date 2020/3/2.
 */
public class Test2 {

    public static void main(String[] args) {
        LinkedHashMap cache = new MyLinkedHashMap(3,0.75f,true);
        for (int i = 0; i < 10; i++) {
            cache.put(i, i * i);
        }

        System.out.println("插入10个键值对后，缓存内容：");
        System.out.println(cache + "\n");

        System.out.println("访问键值为7的节点后，缓存内容：");
        cache.get(7);
        System.out.println(cache + "\n");

        System.out.println("插入键值为1的键值对后，缓存内容：");
        cache.put(1, 1);
        System.out.println(cache);
    }

}
